package com.learning;

/**
 * @author： ygl
 * @date： 2018/10/09
 * @Description：
 */
public class Thread002 {

    public static void main(String[] args) {
        System.out.println("主线程开始－－－－－－－");
        // 创建线程
        ThreadDemo2 threadDemo02 = new ThreadDemo2();
        Thread t1 = new Thread(threadDemo02);
        // 启动线程
        t1.start();
        for (int i = 0; i < 10; i++) {
            System.out.println("main－－－－i:"+i);
        }
        System.out.println("主线程结束－－－－－－－");
    }
}

class ThreadDemo2 implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 10 ; i++) {
            System.out.println("子－－－i:"+i);
        }
    }
}